/**
 * 日终策略分析
 */
import React, {Component} from 'react';
import {connect} from 'dva';
import {routerRedux,Link} from 'dva/router'
import {Row, Col, Table, Card, DatePicker} from 'antd';
import moment from 'moment';
moment.locale('zh-cn');
import '../common.less'
import { Tabtitle, IECharts,NoData} from '../../../../components'
import {
		ToolBar,
		CostData,
		CostChart,
		PriceChart
	} from '../components'
import style from './index.less'



const DailysummaryStrategy = ({
		dispatch,
		dailysummaryStrategy,
		location
	}) => {
	const {pathname,query}=location
	const tag='dailysummaryStrategy'
	const {
		date,
		fundId,
		orderNo,
		fundList,
		pie,
		table,
		trendChart
	} = dailysummaryStrategy
	const toolbarProps={
		tag,
		date,
		fundId,
		fundList,
		dispatch,
		location
	},
	costDataProps={
		tag,
		dispatch,
		location,
		data:table,
		date,
		fundId,
		orderNo
	},
	costChartProps={
		data:pie
	},
	priceChartProps={
		data:trendChart
	}

	return (
		<div className={`tca ${style.strategy}`}>
			<Tabtitle value={'日终策略分析'}/>
			<div className="content-inner">
				<ToolBar {...toolbarProps}/>
				{
					(pie&&pie.data)&&(table&&table.data)&&(trendChart&&trendChart.data)?<div>
						<Card title="隐性成本" bordered={false}  className="module impcost">
							<Row>
								<Col span={14}>
									<div className="wrap">
										<CostData {...costDataProps} />
									</div>
								</Col>
								<Col span={10}>
									<div className="wrap" style={{marginLeft:20}}>
										<CostChart {...costChartProps} />
									</div>
								</Col>
							</Row>
						</Card>
						<Card title="价格走势" bordered={false}  className="module trend">
							<Row>
								<Col span={24}>
									<div  className={`chart line ${style.line}`}>
										<PriceChart {...priceChartProps} />
									</div>
								</Col>
							</Row>
						</Card>
					</div>:<NoData />
				}

			</div>
		</div>
	)

}

DailysummaryStrategy.propTypes = {}

export default connect(({dailysummaryStrategy})=>({dailysummaryStrategy}))(DailysummaryStrategy)
